#include "guitests.h"
#include "cpplexer.h"
#include "lexertestingclass.h"
#include <QtGui/QApplication>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <QTextStream>
#include <QTextCodec>

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	guiTests w;
	w.show();

	LexerTestingClass t;
	QTest::qExec(&t);

	QTextCodec *codec = QTextCodec::codecForName("CP1251");
	QTextCodec::setCodecForCStrings(codec);
	setlocale(LC_ALL,"Russian"); 

	QFile file; 
    file.setFileName("testing.log"); 
    file.open(QIODevice::WriteOnly);
	QTextStream stream(&file);

	QVector<QString> tRes;
	tRes = t.testResults();
	for(int i=0; i<tRes.size();i++)
	{
		stream <<tRes[i];
		stream<<"\r\n";
	}
	file.close();

	return a.exec();
}
